/*
 * KeyboardIO.c
 *
 *  Created on: Mar 10, 2012
 *      Author: Dan
 *      This waits for keyboard input and generates an interrupt.
 */
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

void pause(int wait) {
	int i;
	for (i = 0; i < wait; i++);
}

void* runKeyboard(int* kbio) {
	//static char buffer[255]; //lets assume we wont be typing more than 100 chars
    while (1) {
    	char c = getchar();
        while (c != '\n')
           c = getchar();
        *kbio = 1;
    	printf("Keyboard Input Accepted\n", *kbio);
    	fflush(stdout);
	}
	return NULL;
}

void* runAux(int* auxio) {
	while (1) {
		pause(15000000000);
		printf("=============Aux Device Interupt!==============\n");
		fflush(stdout);
		*auxio = 1;

	}
	return NULL;
}

